package org.moonholder.springboot.damocles.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.moonholder.springboot.damocles.entity.User;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;


/**
 * <p>
 * 后台用户表 服务类
 * </p>
 *
 * @author MoonHolder
 * @since 2020-12-19
 */
public interface IUserService extends IService<User> {
    boolean isExistUser(User user);

    boolean setRoleTheUser(User user, String roleCode);

    User findLoginUserByRequest(HttpServletRequest request);

    IPage<User> findUserPageFormAuth(Page<User> page, User user);

    boolean updateByUsername(User user);

    boolean updateUserRole(Integer userId, Integer roleId);

    void userFreeze(String username, Date date);

    void userUnfreeze(String username);

    IPage<User> findUserPageFormUser(User user, Page<User> page);

    List<User> findUserByRoleId(Integer roleId);

    IPage<User> findNotSignUserPageByCondition(HttpServletRequest request, User user, Page<User> page);

    User getCurrentUser(HttpServletRequest request);
}
